using System;
using Fornax020.SerialComm.Commands;

namespace Fornax020.SerialComm.Core
{
    /// <summary>
    /// 串口命令工厂 - 工厂模式的具体实现
    /// 工厂模式：创建对象而不指定它们的具体类
    /// </summary>
    public static class CommandFactory
    {
        /// <summary>
        /// 创建KV设置命令
        /// </summary>
        public static SetKvCommand CreateSetKvCommand(double kvValue)
        {
            return new SetKvCommand(kvValue);
        }

        /// <summary>
        /// 创建MA设置命令
        /// </summary>
        public static SetMaCommand CreateSetMaCommand(double maValue)
        {
            return new SetMaCommand(maValue);
        }

        /// <summary>
        /// 创建开始曝光命令
        /// </summary>
        public static StartExposureCommand CreateStartExposureCommand()
        {
            return new StartExposureCommand();
        }

        /// <summary>
        /// 创建停止曝光命令
        /// </summary>
        public static StopExposureCommand CreateStopExposureCommand()
        {
            return new StopExposureCommand();
        }

        /// <summary>
        /// 创建监控查询命令
        /// </summary>
        public static MonitorQueryCommand CreateMonitorQueryCommand()
        {
            return new MonitorQueryCommand();
        }

        /// <summary>
        /// 创建固件版本查询命令
        /// </summary>
        public static VersionQueryCommand CreateVersionQueryCommand()
        {
            return new VersionQueryCommand();
        }

        /// <summary>
        /// 创建清除错误命令
        /// </summary>
        public static ClearErrorCommand CreateClearErrorCommand()
        {
            return new ClearErrorCommand();
        }
    }
}
